<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <title>CRM账号绑定</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link href="/common/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/common/assets/css/icons.css" rel="stylesheet" type="text/css">
    <link href="/common/assets/css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="wrapper-page">
    <div class="card-body" >
        <h3 class="text-center mt-0 m-b-15">
            <a href="index.html" class="logo logo-admin">CRM账号绑定</a>
        </h3>

        <div class="p-3">
            <form id="f1" class="form-horizontal m-t-20">
                <input type="hidden" name="wxId" value="${WxUserId}">
                <div class="form-group row">
                    <div class="col-12">
                        <input class="form-control" type="text" name="username" required="" placeholder="用户名">
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-12">
                        <input class="form-control" type="password" name="pwd" required="" placeholder="密码">
                    </div>
                </div>
            </form>
            <div class="form-group text-center row m-t-20">
                <div class="col-12">
                    <button id="btn" class="btn btn-danger btn-block waves-effect waves-light" type="submit">绑定</button>
                </div>
            </div>
        </div>

    </div>
</div>
<!-- jQuery  -->
<script src="/common/assets/js/jquery.min.js"></script>
<script src="/common/assets/js/popper.min.js"></script>
<script src="/common/assets/js/bootstrap.min.js"></script>
<script src="/common/assets/js/modernizr.min.js"></script>
<script src="/common/assets/js/waves.js"></script>
<script src="/common/assets/js/jquery.slimscroll.js"></script>
<script src="/common/assets/js/jquery.nicescroll.js"></script>
<script src="/common/assets/js/jquery.scrollTo.min.js"></script>

<!-- App js -->
<script src="/common/assets/js/app.js"></script>
<script>
    $('#btn').click(function(){
        $.ajax({
            type: "post",
            url: "/com/imelite/qyh/UserAction/updateUser.do",
            data: $('#f1').serialize(),
            success: function (data) {
                if (data.status == 200 || data.code == 200) {
                    window.location.href="${url}";
                } else {
                    alert(data.msg);
                }
            },
            error: function () {
                alert("发生异常");
            }
        });
    });
</script>
</body>
</html>